package fr.cdj.thebox.client.gin;

import net.customware.gwt.presenter.client.DefaultEventBus;
import net.customware.gwt.presenter.client.EventBus;

import com.google.gwt.inject.client.AbstractGinModule;
import com.google.gwt.inject.client.assistedinject.GinFactoryModuleBuilder;

import fr.cdj.thebox.client.app.ui.TheboxDisplay;
import fr.cdj.thebox.client.app.ui.TheboxDisplayImpl;
import fr.cdj.thebox.client.content.FileItemPresenter;
import fr.cdj.thebox.client.content.ui.ContentDisplay;
import fr.cdj.thebox.client.content.ui.ContentDisplayImpl;
import fr.cdj.thebox.client.content.ui.FileItemDisplay;
import fr.cdj.thebox.client.content.ui.FileItemDisplayImpl;
import fr.cdj.thebox.client.menu.ui.MenuDisplay;
import fr.cdj.thebox.client.menu.ui.MenuDisplayImpl;

public class TheboxGModule extends AbstractGinModule {

	@Override
	protected void configure() {
		bind(EventBus.class).to(DefaultEventBus.class);
		bind(TheboxDisplay.class).to(TheboxDisplayImpl.class);
		bind(MenuDisplay.class).to(MenuDisplayImpl.class);
		bind(ContentDisplay.class).to(ContentDisplayImpl.class);
		
		install(new GinFactoryModuleBuilder().implement(FileItemDisplay.class, FileItemDisplayImpl.class).build(FileItemDisplay.Factory.class));
		install(new GinFactoryModuleBuilder().build(FileItemPresenter.Factory.class));
	}

}
